<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../plugins/mui/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../../css/directory/detail.css" />
		<script src="../../js/statistics.js"></script>
		<style>
			.header a{
				color:#fff;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav header">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title" id='title'>公司详情</h1>
		</header>
		
		<div id='map'></div>
		<div class='mui-content'>
			<ul class='mui-table-view info'>
				<p class='li_title'><i></i>基本信息</p>
				
			</ul>

			<ul class='mui-table-view main'>
				<p class='li_title'><i></i>常用信息</p>
				<li>
					<img src="../../images/icon/directory/holder.png" alt="" />
					<p>股东信息</p>
				</li>
				<li>
					<img src="../../images/icon/directory/member.png" alt="" />
					<p>主要成员</p>
				</li>
				<li>
					<img src="../../images/icon/directory/change.png" alt="" />
					<p>变更记录</p>
				</li>
				<li>
					<img src="../../images/icon/directory/invest.png" alt="" />
					<p>对外投资</p>
				</li>
				<li>
					<img src="../../images/icon/directory/report.png" alt="" />
					<p>企业年报</p>
				</li>
				<li>
					<img src="../../images/icon/directory/website.png" alt="" />
					<p>企业网站</p>
				</li>
				<li>
					<img src="../../images/icon/directory/recruit.png" alt="" />
					<p>企业招聘</p>
				</li>
				<li>
					<img src="../../images/icon/directory/approve.png" alt="" />
					<p>资质认证</p>
				</li>
			</ul>
		</div>
		<script src="../../plugins/jquery/jquery-3.1.0.min.js" type="text/javascript" ></script>
		<script src="../../plugins/mui/mui.min.js"></script>
		<script src="../../plugins/template/template.js" type="text/javascript" ></script>
		<script src="../../js/md5.js" type="text/javascript"></script>
		<script src="../../js/getApiToken.js" type="text/javascript"></script>
		<!--<script type="text/javascript" src="../../js/judge.js" ></script>-->
		<script type="text/html" id="info">
			<li class='mui-table-view-cell'>
				<p>公司名称</p>
				<p>{{data.name}}</p>
			</li>
			<li class='mui-table-view-cell'>
				<p>公司税号</p>
				<p>{{data.duty_number}}</p>
			</li>
			<li class='mui-table-view-cell'>
				<p>法人代表</p>
				<p>{{data.legal_person}}</p>
			</li>
			<li class='mui-table-view-cell'>
				<p>注册资金</p>
				<p>{{data.money}}</p>
			</li>
			<li class='mui-table-view-cell'>
				<p>注册时间</p>
				<p>{{data.time}}</p>
			</li>
			<li class='mui-table-view-cell'>
				<p>企业类型</p>
				<p>私营企业</p>
			</li>
			<li class='mui-table-view-cell' id="address">
				<p>办公地址</p>
				<p class='address'>{{data.address}}</p>
			</li>
			<li class='mui-table-view-cell' id="tel">
				<p>联系电话</p>
				<p class='tell'>{{data.tel}}</p>
			</li>
			<li class='mui-table-view-cell'>
				<p>经营范围</p>
				<p>{{data.business}}</p>
			</li>
		</script>
		<script type="text/javascript">
			mui.init();
			mui.plusReady(function() {
				var ws = plus.webview.currentWebview(),
					id = ws.companyId;
				myAnotherAjax('administration/administration/companyDetail', 'get', {
					id: id
				}, function(data) {
					if(data.success){
						var info = {},
						html = '';
						info.data = data;
						var html = template('info', info);
						$('.info').append(html);
						var p = $('.info li:last-child').find('p:last-child');
						var text = p.text();
						text = text.replace('<p>', '').replace('</p>', '');
						$('.info li:last-child').find('p:last-child').text(text);
					}
					
				});
				$('body').delegate('#tel', 'tap', function(e) {
					var telephone = $('.tell').text();
					mui.confirm(telephone, '提示', ['取消', '拨打'], function(value) {
						if(value.index == 1) {
							var Uri = plus.android.importClass("android.net.Uri");
							var Intent = plus.android.importClass("android.content.Intent");
							var number = new Uri.parse("tel:"+telephone);
							var callIntent = new Intent(Intent.ACTION_CALL, number); 
							plus.android.runtimeMainActivity().startActivity(callIntent);
						}
					});
					e.preventDefault();
				});
				$('body').delegate('#address', 'touchstart', function(e) {
					var address = $('.address').text();
					// 设置目标位置坐标点和其实位置坐标点
//					var map = new plus.maps.Map('map');	
//					map.getUserLocation(function(status,point) { //获取当前位置
//						plus.maps.Map.reverseGeocode(point,{},function(event){
//							var addressSrc = event.address;  // 转换后的地理位置
//							mui.openWindow({
//								url:'../executive_housekeeper/map.html',
//								id:'map.html',
//								extras:{
//									'address':address,
//									'startAddress':addressSrc
//								},
//								waiting:{
//									autoShow:true,//自动显示等待框，默认为true
//		      						title:'正在加载...',//等待对话框上显示的提示内容
//								}
//							})
//						},function(e){
//							alert("Failed:"+JSON.stringify(e));
//						});
//					})
					mui.openWindow({
						url:'../executive_housekeeper/map.html',
						extras:{
							'address':address
						},
						waiting:{
							autoShow:true,//自动显示等待框，默认为true
	  						title:'正在加载...',//等待对话框上显示的提示内容
						}
					})
					e.preventDefault();
				});
			});
		</script>
	</body>

</html>